package com.xmuexp109.exp5.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
/**
 * 订单明细视图对象
 **/
@Data
@ApiModel(description = "订单明细")
public class orderItemVo {
    @ApiModelProperty(value = "sku序号")
    @NotBlank
    private Long goodsSkuId;

    @NotBlank
    @ApiModelProperty(value = "数量")
    private Integer quantity;

    @ApiModelProperty(value = "优惠活动id")
    @NotBlank
    private Long couponActivityId;


    public orderItem createOrderItem(){
        orderItem orderItem = new orderItem();
        orderItem.setGoodsSkuId(this.goodsSkuId);
        orderItem.setQuantity(this.quantity);
        orderItem.setCouponActivityId(this.couponActivityId);
        return orderItem;
    }
}
